package com.csgc.camera.widget.dialog.base

import android.content.Context
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.annotation.LayoutRes
import androidx.annotation.StyleRes

import com.csgc.camera.util.ViewUtils
import com.cysd.spsyxj.R


class BottomDialog constructor(context: Context, @StyleRes themeResId: Int = R.style.BaseDialogTheme):
        BaseDialog(context,themeResId){

    private val containerLayout: ViewGroup? by lazy { findViewById(R.id.ll_bottom_container) }
      init {
        setContentView(R.layout.dialog_bottom)
        setWindowAnimations(AnimAction.ANIM_BOTTOM)
        setGravity(Gravity.BOTTOM)
        setWidth((ViewUtils.getScreenWidth(context)))
      }

    fun setCustomView(@LayoutRes id: Int) {
        setCustomView(LayoutInflater.from(context).inflate(id, containerLayout, false))
    }
    private fun setCustomView(view: View?) {
        containerLayout?.addView(view)
    }
}